﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for DatabaseAccess
/// </summary>
public class DatabaseAccess
{
    String connectionString = "Data Source=OLSON140SERVER;Initial Catalog=BPI_Library;Integrated Security=True";


    public DatabaseAccess()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public DataSet getAllAnnouncements(int LibraryID)
    {
        SqlConnection con = new SqlConnection(connectionString);
        con.Open();
        SqlDataAdapter command = new SqlDataAdapter("exec ANNOUNCEMENT_SELECT " + LibraryID, con);
        con.Close();
        DataSet ds = new DataSet();
        command.Fill(ds);
        return ds;
    }
    public DataSet getAllEvents(int LibraryID)
    {
        SqlConnection con = new SqlConnection(connectionString);
        con.Open();
        SqlDataAdapter command = new SqlDataAdapter("exec EVENT_SELECT " + LibraryID, con);
        con.Close();
        DataSet ds = new DataSet();
        command.Fill(ds);
        return ds;
    }

}
